<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/**
<span class='line'>  2</span>  * 文本框控件,继承自&lt;a href="FDFieldComponent.html">FDFieldComponent&lt;/a>&lt;br>
<span class='line'>  3</span>  * @example 示例:
<span class='line'>  4</span>  * &lt;pre>&lt;code>
<span class='line'>  5</span> // 设置JS路径
<span class='line'>  6</span> FDLib.setDir('../../src/');
<span class='line'>  7</span> 
<span class='line'>  8</span> var remark;
<span class='line'>  9</span> FDLib.loadJs('FDTextArea',function() {
<span class='line'> 10</span> 	remark = new FDTextArea({domId:'remark'
<span class='line'> 11</span> 		//,width:300,height:80
<span class='line'> 12</span> 		,name:'addr',label:'地址:',labelValign:'top'
<span class='line'> 13</span> 		,validates:[new FDValidate({minLength:4,maxLength:10})]});
<span class='line'> 14</span> });
<span class='line'> 15</span>  * &lt;/code>&lt;/pre>
<span class='line'> 16</span>  * @param options 参见{@link #getOptions}返回的对象
<span class='line'> 17</span>  * @constructor
<span class='line'> 18</span>  * 2012-7-31
<span class='line'> 19</span>  */</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">FDTextArea</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">options</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="WHIT">	</span><span class="NAME">FDTextArea.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="NAME">options</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT">	</span><span class="NAME">this.options</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">FDLib.util.apply</span><span class="PUNC">(</span><span class="NAME">this.getOptions</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">options</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 24</span> 
<span class='line'> 25</span> </span><span class="NAME">FDLib.extend</span><span class="PUNC">(</span><span class="NAME">FDTextArea</span><span class="PUNC">,</span><span class="NAME">FDTextBox</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 26</span> 
<span class='line'> 27</span> </span><span class="COMM">/**
<span class='line'> 28</span>  * 覆盖父类方法,获取组件的默认属性
<span class='line'> 29</span>    @return &lt;pre>&lt;code>返回json数据类型
<span class='line'> 30</span> {
<span class='line'> 31</span> 	domId:null // 定位的节点ID
<span class='line'> 32</span> 	,label:"" // 控件前面要显示的文字
<span class='line'> 33</span> 	,labelAlign:'right' // label水平对齐方式
<span class='line'> 34</span> 	,labelValign:'top' // label垂直对齐方式
<span class='line'> 35</span> 	,name:"" // 控件的name
<span class='line'> 36</span> 	,width:240 // 控件的宽,如'120px'
<span class='line'> 37</span> 	,height:80 // 控件的高,如'30px'
<span class='line'> 38</span> 	,validates:[] // 验证类
<span class='line'> 39</span> 	,defaultValue:'' // 默认值
<span class='line'> 40</span> }&lt;/code>&lt;/pre>
<span class='line'> 41</span>  */</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="COMM">//@override</span><span class="WHIT">
<span class='line'> 43</span> </span><span class="NAME">FDTextArea.prototype.getOptions</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">options</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">FDTextArea.superclass.getOptions.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">FDLib.util.apply</span><span class="PUNC">(</span><span class="NAME">options</span><span class="PUNC">,</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT">		</span><span class="NAME">width</span><span class="PUNC">:</span><span class="NUMB">240</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT">		</span><span class="PUNC">,</span><span class="NAME">height</span><span class="PUNC">:</span><span class="NUMB">80</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="WHIT">		</span><span class="PUNC">,</span><span class="NAME">labelValign</span><span class="PUNC">:</span><span class="STRN">'top'</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 51</span> 
<span class='line'> 52</span> </span><span class="COMM">/**
<span class='line'> 53</span>  * @private
<span class='line'> 54</span>  */</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="COMM">//@override</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="NAME">FDTextArea.prototype.buildControlDom</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">textarea</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createElement</span><span class="PUNC">(</span><span class="NAME">FDTag.TEXTAREA</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT">	</span><span class="NAME">textarea.setAttribute</span><span class="PUNC">(</span><span class="STRN">'name'</span><span class="PUNC">,</span><span class="NAME">this.options.name</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="WHIT">	</span><span class="NAME">textarea.className</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.options.defaultClassName</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">textarea</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 62</span> </span></pre></body></html>